﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Neeko.XNA.UI
{
    public class Label
    {
        public String Text { get; set; }
        public Vector2 Position { get; set; }
        public Color Color { get; set; }

        public float Scale { get; set; }

        public Label(Vector2 position, String text, Color color)
        {
            this.Position = position;
            this.Text = text;
            this.Color = color;
            this.Font = UIResourceRepository.UIFont;
            this.Scale = 1.0f;
        }
        public Label(Vector2 position, String text) : this(position, text, Color.Gray) { }
        public Label(String text) : this(Vector2.Zero, text, Color.Gray) { }
        public Label() : this(Vector2.Zero, "", Color.Gray) { }

        public SpriteFont Font { get; set; }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.DrawString(this.Font, this.Text, this.Position - Vector2.One / 2, Color.Black, 0f, Vector2.Zero, this.Scale, SpriteEffects.None, 0f);
            spriteBatch.DrawString(this.Font, this.Text, new Vector2((int)this.Position.X, (int)this.Position.Y), this.Color, 0f, Vector2.Zero, this.Scale, SpriteEffects.None, 0f);
        }
    }
}
